<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>第一轮测试</title>
    <link rel="icon" href="../images/touxiang.ico" type="image/x-icon">
    <link rel="stylesheet" href="style.css">
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.js"></script>
    <script src="formjson.js"></script>
    <script type="text/javascript">
        function displaySubMenu(li) {
            var subMenu = li.getElementsByTagName("ul")[0];
            subMenu.style.display = "block";
        }

        function hideSubMenu(li) {
            var subMenu = li.getElementsByTagName("ul")[0];
            subMenu.style.display = "none";
        }
    </script>

</head>

<body>
    <img src="../images/fantang.png" alt="" id="logo">
    <ul id="navigation">
        <li onmouseover="displaySubMenu(this)" onmouseout="hideSubMenu(this)">
            <center><a href="#">你想看的</a></center>
            <ul>
                <li><a href="../index.html">我的主页</a></li>
                <li><a href="1.html">第一轮测试</a></li>
                <li><a href="2.html">第二轮测试</a></li>
                <li><a href="3-1.html">第三轮测试</a></li>
                <li><a href="4.html">第四轮测试</a></li>
            </ul>
        </li>
    </ul>
    <div id=“container”>
    </div>
    <div id="container">
        <div id="content">
            <div id="begin">
                <h1>第一轮测试</h1>
                <p>请填写以下问题<br>
                </p>
            </div>
            <form id="form">
                <div id="photos">

                    <div class="useName">
                        <p><label for="useName">1.您的姓名：</label><input type="text" name="&#34e_name&#34" id="useName" />
                        </p>
                        <p><label for="useName">2.您的序号：</label><input type="text" name="&#34e_id&#34" id="useNo" /></p>
                    </div><br>

                    <p>3.如果要对学一食堂（东区一楼）进行评价，您的评分是：
                        <br><input type="radio" name="pingfen1" value="1">1
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="pingfen1" value="2">2
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="pingfen1" value="3">3
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="pingfen1" value="4">4
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="pingfen1" value="5">5
                        <br><input type="radio" name="pingfen1" value="6">6
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="pingfen1" value="7">7
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="pingfen1" value="8">8
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="pingfen1" value="9">9
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="pingfen1" value="10">10
                    </p><br>
                    <p>4.如果要对禾园餐厅（东区二楼）进行评价，您的评分是：
                        <br><input type="radio" name="pingfen2" value="1">1
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="pingfen2" value="2">2
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="pingfen2" value="3">3
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="pingfen2" value="4">4
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="pingfen2" value="5">5
                        <br><input type="radio" name="pingfen2" value="6">6
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="pingfen2" value="7">7
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="pingfen2" value="8">8
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="pingfen2" value="9">9
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="pingfen2" value="10">10
                    </p><br>
                    <p>5.如果要对林园餐厅（东区三楼）进行评价，您的评分是：
                        <br><input type="radio" name="pingfen3" value="1">1
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="pingfen3" value="2">2
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="pingfen3" value="3">3
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="pingfen3" value="4">4
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="pingfen3" value="5">5
                        <br><input type="radio" name="pingfen3" value="6">6
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="pingfen3" value="7">7
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="pingfen3" value="8">8
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="pingfen3" value="9">9
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="pingfen3" value="10">10
                    </p><br>
                    <p>6.如果要对学二餐厅（西区一楼）进行评价，您的评分是：
                        <br><input type="radio" name="pingfen4" value="1">1
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="pingfen4" value="2">2
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="pingfen4" value="3">3
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="pingfen4" value="4">4
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="pingfen4" value="5">5
                        <br><input type="radio" name="pingfen4" value="6">6
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="pingfen4" value="7">7
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="pingfen4" value="8">8
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="pingfen4" value="9">9
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="pingfen4" value="10">10
                    </p><br>
                    <p>7.如果要对齐芳阁（西区二楼）进行评价，您的评分是：
                        <br><input type="radio" name="pingfen5" value="1">1
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="pingfen5" value="2">2
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="pingfen5" value="3">3
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="pingfen5" value="4">4
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="pingfen5" value="5">5
                        <br><input type="radio" name="pingfen5" value="6">6
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="pingfen5" value="7">7
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="pingfen5" value="8">8
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="pingfen5" value="9">9
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="pingfen5" value="10">10
                    </p><br>
                    <p>8.如果要对林汇园（西区三楼）进行评价，您的评分是：
                        <br><input type="radio" name="pingfen6" value="1">1
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="pingfen6" value="2">2
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="pingfen6" value="3">3
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="pingfen6" value="4">4
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="pingfen6" value="5">5
                        <br><input type="radio" name="pingfen6" value="6">6
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="pingfen6" value="7">7
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="pingfen6" value="8">8
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="pingfen6" value="9">9
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="pingfen6" value="10">10
                    </p>
                </div>
            </form>

        </div>
        <div align="center" id="header">
            <div id="anniu"><a onClick="submitToNextPage()">完成测试</a>
            </div>
        </div>
    </div>
    </div>

    <script>
        let storageItemName = "nl-formJson";

        $(function () {
            // json信息加载到form表单中
            loadStorageJsonToForm({
                item: storageItemName
            });


        });

        /** 提交当前页表单，并跳转到下一页 */
        function submitToNextPage() {
            let json = $("#form").serializeJson();
            console.log(json);
            var temp1 = new Object();
            temp1.e_id = json["\"e_id\""];
            temp1.e_name = json["\"e_name\""];

            var temp2 = [];
            for (var i = 0; i < 6; i++) {
                var temp21 = new Object();
                temp21.e_id = Number(json["\"e_id\""]);
                temp21.c_id = i + 1;
                var pp = i + 1;
                var p = "pingfen" + pp;
                temp21.score = Number(json[p]);
                temp2[i] = temp21;
            }
            $.get("/app1Router", temp1, function (d) {
                //alert(d);
            });
            var tempJson = JSON.stringify(temp2); //这里给当前专家的对每一个食堂的评价
            //temp = "(" + temp + ")";
            setTimeout(() => {
                console.log('第1个定时器回调')
            }, 100)
            $.get("/app2Router", tempJson, function (d) {
               // alert(d);
            });
            serialFormJsonToStorage({
                item: storageItemName,
                handle: function (obj) {}
            });
            saveFormData();
            window.localStorage.removeItem(storageItemName);
            //insertExpn(storageItemName);
            alert("提交成功");
            window.location = "finish.html";
        }

        /** 提交当前页表单 */
        function submitForm() {
            let json = $("#form").serializeJson();
            console.log(json);
            //alert("保存成功");
        }

        function saveFormData() {
            json = serialFormJsonToStorage({
                item: storageItemName
            });
        }

        function submit() {
            saveFormData();
            // 最后一步提交后需要移除storageItemName,避免影响下一次表单填写的json信息
            window.localStorage.removeItem(storageItemName);
            window.location = "finish.html";
        }
    </script>

</body>

</html>